const autoprefixer = require('autoprefixer')
const pxtoviewport = require('postcss-px-to-viewport')
const webpack = require('webpack')
module.exports = {
  outputDir: 'dist',
  publicPath: process.env.NODE_ENV === 'production' ? '/vue3txmap/' : '/',
  css: {
    loaderOptions: {
      postcss: {
        plugins: [
          autoprefixer(),
          pxtoviewport({
            viewportWidth: 375
          })
        ]
      }
    }
  },

  devServer: {
    proxy: {
      //设置代理，必须填
      '/ws': {
        target: 'https://apis.map.qq.com',
        changeOrigin: true,
        pathRewrite: {}
      }
    }
  },
  configureWebpack: {
    plugins: [
      new webpack.ProvidePlugin({
        $: 'jquery',
        jQuery: 'jquery',
        'window.jQuery': 'jquery',
        Popper: ['popper.js', 'default']
      })
    ]
  }
}
